<?php
/** 
 * $Source: /cvsroot/pn-commerce/pn-commerce/pntemplates/plugins/function.pncManualURL.php,v $
 * $Author: pcornelissen $
 * $Revision: 1.6 $
 * $Date: 2003/12/08 12:09:47 $
 *
 * Type: Function
 *
 * Purpose:  returns the URL to the given chapter in the current language. Fallback is english
 */
function smarty_function_pncManualURL($params, &$smarty)
{
 $lang= pnUserGetLang();
  if($params['Chapter']) $params['Chapter']='#'.$params['Chapter'];
  if(file_exists('modules/pncommerce/pndocs/lang/'.$lang.'/manual/manual.html'))
  {
      $url='modules/pncommerce/pndocs/lang/'.$lang.'/manual/manual.html'.$params['Chapter'];
  } 
  else $url='modules/pncommerce/pndocs/lang/eng/manual/manual.html'.$params['Chapter'];
  
  if(($params['OpenHelpWindow']=='1')||($params['OpenHelpWindow']=='true'))
  {
    return 'href="#" ONCLICK="manualwindow'."('$url'".",'Event','status=yes,scrollbars=yes,resizable=yes,width=750,height=500')".'"""';
  }
  else{
    return 'href="'.$url.'"';
  }
}
?>
